home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / s342q07.lha / zmodem.h < prev   
Text File  |  1995-04-09  |  5KB  |  102 lines

  1. /*
  2.  *   Z M O D E M . H     Manifest constants for ZMODEM
  3.  *    application to application file transfer protocol
  4.  *    01-15-87  Chuck Forsberg Omen Technology Inc
  5.  */
  6.  
  7. #define ZPAD    '*'             /* 052 Padding character begins frames */
  8. #define ZDLE    030             /* Ctrl-X Zmodem escape - `ala BISYNC DLE */
  9. #define ZDLEE   (ZDLE^0100)     /* Escaped ZDLE as transmitted */
  10. #define ZBIN    'A'             /* Binary frame indicator */
  11. #define ZHEX    'B'             /* HEX frame indicator */
  12. #define ZBIN32  'C'             /* Binary frame with 32 bit FCS */
  13. #define ZBINR32 'D'             /* RLE packed Binary frame with 32 bit FCS */
  14. #define ZRESC   0176            /* RLE flag/escape character */
  15.  
  16. /* Frame types (see array "frametypes" in zm.c) */
  17. #define ZRQINIT     0           /* Request receive init */
  18. #define ZRINIT      1           /* Receive init */
  19. #define ZSINIT      2           /* Send init sequence (optional) */
  20. #define ZACK        3           /* ACK to above */
  21. #define ZFILE       4           /* File name from sender */
  22. #define ZSKIP       5           /* To sender: skip this file */
  23. #define ZNAK        6           /* Last packet was garbled */
  24. #define ZABORT      7           /* Abort batch transfers */
  25. #define ZFIN        8           /* Finish session */
  26. #define ZRPOS       9           /* Resume data trans at this position */
  27. #define ZDATA      10           /* Data packet(s) follow */
  28. #define ZEOF       11           /* End of file */
  29. #define ZFERR      12           /* Fatal Read or Write error Detected */
  30. #define ZCRC       13           /* Request for file CRC and response */
  31. #define ZCHALLENGE 14           /* Receiver's Challenge */
  32. #define ZCOMPL     15           /* Request is complete */
  33. #define ZCAN       16           /* Other end canned session with CAN*5 */
  34. #define ZFREECNT   17           /* Request for free bytes on filesystem */
  35. #define ZCOMMAND   18           /* Command from sending program */
  36. #define ZSTDERR    19           /* Output to standard error, data follows */
  37.  
  38. /* ZDLE sequences */
  39. #define ZCRCE   'h'             /* CRC next, frame ends, header packet follows */
  40. #define ZCRCG   'i'             /* CRC next, frame continues nonstop */
  41. #define ZCRCQ   'j'             /* CRC next, frame continues, ZACK expected */
  42. #define ZCRCW   'k'             /* CRC next, ZACK expected, end of frame */
  43. #define ZRUB0   'l'             /* Translate to rubout 0177 */
  44. #define ZRUB1   'm'             /* Translate to rubout 0377 */
  45.  
  46. /* zdlread return values (internal) */
  47. /* -1 is general error, -2 is timeout */
  48. #define GOTOR   0400
  49. #define GOTCRCE (ZCRCE|GOTOR)   /* ZDLE-ZCRCE received */
  50. #define GOTCRCG (ZCRCG|GOTOR)   /* ZDLE-ZCRCG received */
  51. #define GOTCRCQ (ZCRCQ|GOTOR)   /* ZDLE-ZCRCQ received */
  52. #define GOTCRCW (ZCRCW|GOTOR)   /* ZDLE-ZCRCW received */
  53. #define GOTCAN  (GOTOR|030)     /* CAN*5 seen */
  54.  
  55. /* Byte positions within header array */
  56. #define ZF0     3               /* First flags byte */
  57. #define ZF1     2
  58. #define ZF2     1
  59. #define ZF3     0
  60. #define ZP0     0               /* Low order 8 bits of position */
  61. #define ZP1     1
  62. #define ZP2     2
  63. #define ZP3     3               /* High order 8 bits of file position */
  64.  
  65. /* Bit Masks for ZRINIT flags byte ZF0 */
  66. #define CANFDX  01              /* Rx can send and receive true FDX */
  67. #define CANOVIO 02              /* Rx can receive data during disk I/O */
  68. #define CANBRK  04              /* Rx can send a break signal */
  69. #define CANRLE  010             /* Receiver can decode RLE */
  70. #define CANLZW  020             /* Receiver can uncompress */
  71. #define CANFC32 040             /* Receiver can use 32 bit Frame Check */
  72. #define ESCCTL 0100             /* Receiver expects ctl chars to be escaped */
  73. #define ESC8   0200             /* Receiver expects 8th bit to be escaped */
  74.  
  75. /* Parameters for ZSINIT frame */
  76. #define ZATTNLEN 32             /* Max length of attention string */
  77. /* Bit Masks for ZSINIT flags byte ZF0 */
  78. #define TESCCTL 0100            /* Transmitter expects ctl chars to be escaped */
  79. #define TESC8   0200            /* Transmitter expects 8th bit to be escaped */
  80.  
  81. /* Parameters for ZFILE frame */
  82. /* Conversion options one of these in ZF0 */
  83. #define ZCBIN   1               /* Binary transfer - inhibit conversion */
  84. #define ZCNL    2               /* Convert NL to local end of line convention */
  85. #define ZCRESUM 3               /* Resume interrupted file transfer */
  86. /* Management options, one of these in ZF1 */
  87. #define ZMNEW   1               /* Transfer if source newer or longer */
  88. #define ZMCRC   2               /* Transfer if different file CRC or length */
  89. #define ZMAPND  3               /* Append contents to existing file (if any) */
  90. #define ZMCLOB  4               /* Replace existing file */
  91. #define ZMSPARS 5               /* Encoding for sparse file */
  92. #define ZMDIFF  6               /* Transfer if dates or lengths different */
  93. #define ZMPROT  7               /* Protect destination file */
  94. /* Transport options, one of these in ZF2 */
  95. #define ZTLZW   1               /* Lempel-Ziv compression */
  96. #define ZTCRYPT 2               /* Encryption */
  97. #define ZTRLE   3               /* Run Length encoding */
  98.  
  99. /* Parameters for ZCOMMAND frame ZF0 (otherwise 0) */
  100. #define ZCACK1  1               /* Acknowledge, then do command */
  101. /* End of Zmodem.h source */
  102.